package com.conpany;

import java.util.Scanner;

public class CException {
    public static void main(String[] args) throws StringTooLException{
        int MAX=10;
        Scanner scan =new Scanner(System.in);
        StringTooLException e=new StringTooLException("the word is too long.");
        System.out.println("Enter a word(less than 10 bytes):  ");

        String word = scan.nextLine();
        int a =word.length();
        System.out.println(a);
        if(a>MAX){
            throw e;
        }
        System.out.println("too long!");

    }
}
